package org.ssc.audience.feign;

import org.ssc.audience.entity.Audience;
import org.ssc.audience.entity.Order;
import org.ssc.audience.entity.Tickethouse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "tickethouse",url = "http://localhost:9000")
public interface TickethouseFeign {

    @GetMapping("/ticket/findAudience/{aname}")
    Audience findAudience(@PathVariable("aname") String aname);

    @PostMapping("/ticket/audienceRegister")
    int audienceRegister(@RequestBody Audience audience);

    @PostMapping("/ticket/audienceLogin")
    Object audienceLogin(@RequestParam("aname") String aname,
                         @RequestParam("password") String password);

    @GetMapping("/ticket/getOrderByAid/{aid}")
    List<Order> getOrderByAid(@PathVariable("aid") int aid);

    @GetMapping("/ticket/getTicketsByMoviename/{moviename}")
    List<Tickethouse> getTicketsByMoviename(@PathVariable("moviename")String moviename);

    @GetMapping("/ticket/buyTicket")
    int buyTicket(@RequestParam("tid")int tid,@RequestParam("aid")int aid);

    @GetMapping("/ticket/getAllTickets")
    List<Tickethouse> getAllTickets();
}
